home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / pascal / faxs11.zip / TESTFAX.PAS < prev   
Pascal/Delphi Source File  |  1993-03-30  |  620b  |  30 lines

  1. { Example for DosExitCode and Exec }
  2.  
  3. {$M $4000,0,0 }   { 16K stack, no heap }
  4. uses Dos;
  5. var
  6.   ProgramName, CmdLine: string;
  7. begin
  8.   Write('Program to Exec (full path): ');
  9.   ReadLn(ProgramName);
  10.   Write('Command line to pass to ',
  11.         ProgramName, ': ');
  12.   ReadLn(CmdLine);
  13.   WriteLn('About to Exec...');
  14.   SwapVectors;
  15.   Exec(ProgramName, CmdLine);
  16.   SwapVectors;
  17.   WriteLn('...back from Exec');
  18.   if DosError <> 0 then{ Error? }
  19.     WriteLn('Dos error #', DosError)
  20.   else
  21.     WriteLn('Exec successful. ',
  22.             'Child process exit code = ',
  23.             DosExitCode);
  24. end.
  25.  
  26.  
  27.  
  28.  
  29.  
  30.